﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Dominio;

namespace HotelGUI
{
    
    public partial class Reservas2 : Form
    {
        private ISistema sistema = Dominio.Fabrica.getSistema();

        public Reservas2()
        {
            InitializeComponent();
        }

        public void setCliente(String idCli, String Nom, String Apel)
        {
            idCliente.Text = idCli;
            nombre.Text = Nom;
            apellido.Text = Apel;
        }


        private void CheckIn_Click(object sender, EventArgs e)
        {
            int resp = sistema.realizarReserva(int.Parse(idCliente.Text), int.Parse(numero.Text), fchin.Value, fchout.Value);
            nroReserva.Text = resp.ToString();
        }

        private void CheckOut_Click(object sender, EventArgs e)
        {

        }

        private void Validar_Click(object sender, EventArgs e)
        {
            List<String> lst = new List<string>();
            int id = int.Parse(idCliente.Text);
            lst = null;//sistema.traerCliente(id);
            apellido.Text = lst[0];
            nombre.Text = lst[1];
        }

        private void idCliente_KeyPress(object sender, KeyPressEventArgs e)
        {
            //MessageBox.Show(e.KeyChar.ToString());
        }

        private void idCliente_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 113 /* F2 */ )
            {
                ListadoClientes lc = new ListadoClientes();
                lc.ShowDialog(this);
            }
        }

    }
}
